AfterlifeServerInitialized = false;

if (isServer || !hasInterface) then
{
	//清理拍卖行过期物品
	call AfterlifeServer_market_inventory_cleanup;
	//加载拍卖行
	call AfterlifeServer_market_inventory_initalize;

	//加载环境系统
	call AfterlifeServer_environment_initialize;

	//Spawn Animal (cause performance issues)
	//call ExileClient_object_animal_spawn;

	//丧尸逻辑
	[
		0.25,
		AfterlifeServer_zombie_thread_idle, [], true
	] call ExileServer_system_thread_addtask;

	//Weather Saving Thread
	[
		120,
		AfterlifeServer_environment_thread_saveWeather, [], true
	] call ExileServer_system_thread_addTask;

	//Time Saving Thread
	[
		120,
		AfterlifeServer_environment_thread_saveTime, [], true
	] call ExileServer_system_thread_addTask;

	//Time Accleration Thread
	[
		60,
		AfterlifeServer_environment_thread_timeAccleration, [], true
	] call ExileServer_system_thread_addTask;
};

//Signal Client
AfterlifeServerInitialized = true;
publicVariable "AfterlifeServerInitialized";
